;16进制数字码到七段代码的转换
dseg segment
    xcode db 8
    ycode db ?
    tab db 1000000b,1111001b,0100100b,0110000b
        db 0011001b,0010010b,0000010b,1111000b
        db 0000000b,0010000b,0001000b,0000011b
        db 1000110b,0100001b,0000110b,0001110b
dseg ends

cseg segment
    assume cs:cseg,ds:dseg
start:
    mov ax,dseg
    mov ds,ax

    
    mov bl,xcode
    and bl,0fh
    xor bh,bh
    mov al,tab[bx]
    mov ycode,al

    mov ah,4ch
    int 21h
cseg ends

end start